package cn.edu.ecut.se2024.dao;


import cn.edu.ecut.se2024.model.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShoppingCartDao {

    @Select("select * from cart_item where user_id = #{userId} and title LIKE CONCAT('%', #{searchInput}, '%')")
    List<ShoppingCart>  queryMyCarts(@Param("userId") int userId, @Param("searchInput") String searchInput);

    @Select("select * from cart_item where user_id = #{userId}")
    List<ShoppingCart> showMyCarts(int userId);
}
